\(\int \sqrt {\frac {a+b x}{x^2}} \, dx\) [382]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 51 \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=2 \sqrt {\frac {a}{x^2}+\frac {b}{x}} x-2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a}}{\sqrt {\frac {a}{x^2}+\frac {b}{x}} x}\right ) \]

[Out]

-2*arctanh(a^(1/2)/x/(a/x^2+b/x)^(1/2))*a^(1/2)+2*x*(a/x^2+b/x)^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2004, 2032, 2038, 634, 212} \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=2 x \sqrt {\frac {a}{x^2}+\frac {b}{x}}-2 \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a}}{x \sqrt {\frac {a}{x^2}+\frac {b}{x}}}\right ) \]

[In]

Int[Sqrt[(a + b*x)/x^2],x]

[Out]

2*Sqrt[a/x^2 + b/x]*x - 2*Sqrt[a]*ArcTanh[Sqrt[a]/(Sqrt[a/x^2 + b/x]*x)]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 634

Int[1/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(1 - c*x^2), x], x, x/Sqrt[b*x + c*x^2
]], x] /; FreeQ[{b, c}, x]

Rule 2004

Int[(u_)^(p_), x_Symbol] :> Int[ExpandToSum[u, x]^p, x] /; FreeQ[p, x] && GeneralizedBinomialQ[u, x] &&  !Gene
ralizedBinomialMatchQ[u, x]

Rule 2032

Int[((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Simp[x*((a*x^j + b*x^n)^p/(p*(n - j))), x] + Dist
[a, Int[x^j*(a*x^j + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b, j, n}, x] && IGtQ[p + 1/2, 0] && NeQ[n, j] && EqQ[
Simplify[j*p + 1], 0]

Rule 2038

Int[(x_)^(m_.)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[(a*x^Simplify[j/n]
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, j, m, n, p}, x] &&  !IntegerQ[p] && NeQ[n, j] && IntegerQ[Simplify[j
/n]] && EqQ[Simplify[m - n + 1], 0]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\frac {a}{x^2}+\frac {b}{x}} \, dx \\ & = 2 \sqrt {\frac {a}{x^2}+\frac {b}{x}} x+a \int \frac {1}{\sqrt {\frac {a}{x^2}+\frac {b}{x}} x^2} \, dx \\ & = 2 \sqrt {\frac {a}{x^2}+\frac {b}{x}} x-a \text {Subst}\left (\int \frac {1}{\sqrt {b x+a x^2}} \, dx,x,\frac {1}{x}\right ) \\ & = 2 \sqrt {\frac {a}{x^2}+\frac {b}{x}} x-(2 a) \text {Subst}\left (\int \frac {1}{1-a x^2} \, dx,x,\frac {1}{\sqrt {\frac {a}{x^2}+\frac {b}{x}} x}\right ) \\ & = 2 \sqrt {\frac {a}{x^2}+\frac {b}{x}} x-2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a}}{\sqrt {\frac {a}{x^2}+\frac {b}{x}} x}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.14 \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=\frac {2 x \sqrt {\frac {a+b x}{x^2}} \left (\sqrt {a+b x}-\sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )\right )}{\sqrt {a+b x}} \]

[In]

Integrate[Sqrt[(a + b*x)/x^2],x]

[Out]

(2*x*Sqrt[(a + b*x)/x^2]*(Sqrt[a + b*x] - Sqrt[a]*ArcTanh[Sqrt[a + b*x]/Sqrt[a]]))/Sqrt[a + b*x]

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.92

method result size
default \(\frac {2 \sqrt {\frac {b x +a}{x^{2}}}\, x \left (\sqrt {b x +a}-\sqrt {a}\, \operatorname {arctanh}\left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )\right )}{\sqrt {b x +a}}\) \(47\)

[In]

int(((b*x+a)/x^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*((b*x+a)/x^2)^(1/2)*x*((b*x+a)^(1/2)-a^(1/2)*arctanh((b*x+a)^(1/2)/a^(1/2)))/(b*x+a)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.82 \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=\left [2 \, x \sqrt {\frac {b x + a}{x^{2}}} + \sqrt {a} \log \left (\frac {b x - 2 \, \sqrt {a} x \sqrt {\frac {b x + a}{x^{2}}} + 2 \, a}{x}\right ), 2 \, x \sqrt {\frac {b x + a}{x^{2}}} + 2 \, \sqrt {-a} \arctan \left (\frac {\sqrt {-a} x \sqrt {\frac {b x + a}{x^{2}}}}{a}\right )\right ] \]

[In]

integrate(((b*x+a)/x^2)^(1/2),x, algorithm="fricas")

[Out]

[2*x*sqrt((b*x + a)/x^2) + sqrt(a)*log((b*x - 2*sqrt(a)*x*sqrt((b*x + a)/x^2) + 2*a)/x), 2*x*sqrt((b*x + a)/x^
2) + 2*sqrt(-a)*arctan(sqrt(-a)*x*sqrt((b*x + a)/x^2)/a)]

Sympy [F]

\[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=\int \sqrt {\frac {a + b x}{x^{2}}}\, dx \]

[In]

integrate(((b*x+a)/x**2)**(1/2),x)

[Out]

Integral(sqrt((a + b*x)/x**2), x)

Maxima [F]

\[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=\int { \sqrt {\frac {b x + a}{x^{2}}} \,d x } \]

[In]

integrate(((b*x+a)/x^2)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt((b*x + a)/x^2), x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.31 \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=\frac {2 \, a \arctan \left (\frac {\sqrt {b x + a}}{\sqrt {-a}}\right ) \mathrm {sgn}\left (x\right )}{\sqrt {-a}} + 2 \, \sqrt {b x + a} \mathrm {sgn}\left (x\right ) - \frac {2 \, {\left (a \arctan \left (\frac {\sqrt {a}}{\sqrt {-a}}\right ) + \sqrt {-a} \sqrt {a}\right )} \mathrm {sgn}\left (x\right )}{\sqrt {-a}} \]

[In]

integrate(((b*x+a)/x^2)^(1/2),x, algorithm="giac")

[Out]

2*a*arctan(sqrt(b*x + a)/sqrt(-a))*sgn(x)/sqrt(-a) + 2*sqrt(b*x + a)*sgn(x) - 2*(a*arctan(sqrt(a)/sqrt(-a)) +
sqrt(-a)*sqrt(a))*sgn(x)/sqrt(-a)

Mupad [B] (verification not implemented)

Time = 9.15 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.31 \[ \int \sqrt {\frac {a+b x}{x^2}} \, dx=2\,x\,\sqrt {\frac {a}{x^2}+\frac {b}{x}}+\frac {\sqrt {a}\,\sqrt {x}\,\mathrm {asin}\left (\frac {\sqrt {a}\,1{}\mathrm {i}}{\sqrt {b}\,\sqrt {x}}\right )\,\sqrt {\frac {a}{x^2}+\frac {b}{x}}\,2{}\mathrm {i}}{\sqrt {b}\,\sqrt {\frac {a}{b\,x}+1}} \]

[In]

int(((a + b*x)/x^2)^(1/2),x)

[Out]

2*x*(a/x^2 + b/x)^(1/2) + (a^(1/2)*x^(1/2)*asin((a^(1/2)*1i)/(b^(1/2)*x^(1/2)))*(a/x^2 + b/x)^(1/2)*2i)/(b^(1/
2)*(a/(b*x) + 1)^(1/2))